#include<stdio.h>
#include<string.h>
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        int i;
        char s[100][20];
        for(i=0;i<n;i++)
        {
            scanf("%s",&s[i]);
        }
        for(i=0;i<n;i++)
        {
            if(strcmp(s[i],"fork")==0||strcmp(s[i],"chopsticks")==0||strcmp(s[i],"bowl")==0||strcmp(s[i],"knife")==0)
            printf("%s ",s[i]);
        }
        printf("\n");

    }
    return 0;
}